/**
 * @file       godemool/bitstream.h
 * @brief      Bit stream buffer.
 * @author     ben "boin" bonoeil
 * @date       2015-02
 */

/* Copyright (c) 2007-2015, ben "boin" bonoeil */

#ifndef GODEMOOL_BASE64_H
#define GODEMOOL_BASE64_H

#include <string>
#include <cassert>

namespace boin { namespace base64 { class string; } }

class boin::base64::string : public std::string {
  unsigned int acu;
public:
  string() : acu(0xFF) {};
  string(int len);
  string(const char * src, int len);
  string(const std::string);
  void Encode(const char * src, int len);
  void Encode(const std::string);

  void clear() {
    acu = 0xFF;
    std::string::clear();
  }
  void push_back(char c);
  const char* data() const {
    assert(acu < 0x100);
    return std::string::data();
  }
  const char* c_str() const {
    assert(acu < 0x100);
    return std::string::c_str();
  }

protected:
  void Padding();
};

#endif

/* Local Variables:  */
/* mode: c++         */
/* End:              */
